<ion-header>
    <ion-navbar class="nav-calm">
        <ion-title>出入库</ion-title>
    </ion-navbar>
</ion-header>

<ion-content padding>
    <div class="button-bar header-btn">
        <a class="button act">出库单</a>
        <a class="button" (click)="ToCollectPage()">收货记录</a>
    </div>
    <div class="sea">
        <ion-item class="item-input">
            <ion-input type="text" [(ngModel)]="keyword" (blur)="blurInput()" (focus)="focusInput()"></ion-input>
        </ion-item>
        <div class="clearInput" (click)="clearInput()" *ngIf="keyword"></div>
        <div class="search" (click)="search()"></div>
    </div>

    <ion-refresher (ionRefresh)="doRefresh($event)">
        <ion-refresher-content
                pullingIcon="arrow-dropdown"
                pullingText="刷新中.."
                refreshingSpinner="circles"
                refreshingText="刷新中..">
        </ion-refresher-content>
    </ion-refresher>
    <div class="mlist" *ngIf="hasStorage">
        <div class="mitem" *ngFor="let item of myItems; let i=index">
            <div class="mtop">
                <div class="left img"><img src="{{imgURL +item.productImg}}" alt="图片"></div>
                <div class="left cont">
                    <div class="name">{{item.productName}}</div>
                    <div class="xiang">出库单号：<span clas="outNo">{{item.outNo}}</span></div>
                    <div class="xiang">已扫：<span class="num">{{item.count}}</span>箱</div>
                    <div class="xiang">去向：<span class="addr">{{item.receivedCompanyName}}</span></div>
                    <div class="xiang">创建时间：<span class="time">{{item.createDate}}</span></div>
                </div>
                <div class="paged" *ngIf="item.status <= '3'">
                    <div class="text">未完成</div>
                    <i class="icon-paged"></i>
                </div>
            </div>
            <div class="mbottom" *ngIf="item.status <= '3'">
                <button ion-button class="btn btn1" (click)="showEditModel(i)">更多操作</button>
                <button ion-button class="btn btn2" (click)="toScan(i)">继续</button>
                <button ion-button class="btn btn3" (click)="ToManagement(i)">完成</button>
            </div>
        </div>
    </div>
    <ion-infinite-scroll (ionInfinite)="doInfinite($event)">
        <ion-infinite-scroll-content
                loadingSpinner="bubbles"
                loadingText="加载更多">
        </ion-infinite-scroll-content>
    </ion-infinite-scroll>
    <div class="no-storage" *ngIf="!hasStorage">
        <div class="no-box">
            <i class="img"></i>
            <div>暂无记录</div>
        </div>
    </div>


</ion-content>
<div class="component-alert" *ngIf="!showAlert">
    <div id="myBox" class="myBox spac-box">
        <div class="tips">
            <div>确定撤消该出库单吗？？</div>
            <div>（已扫{{ myItems[index].count }}箱）</div>
        </div>
        <div class="btns">
            <button ion-button class="btn btn-cancel" (click)="btnCancel()">取消</button>
            <button ion-button class="btn btn-choose" (click)="btnChoose()">确认</button>
        </div>
    </div>
</div>
<div class="FixToBottom" *ngIf="!isOnFocus">
    <button ion-button block class="btn newCreat" (click)="ToNewcreat()">新建出库单</button>
</div>
<div class="editModel" *ngIf="isShowEditModel">
    <ion-list>
        <ion-item><a href="javascript:void(0);" (click)="deleteBox()">删除一箱</a></ion-item>
        <ion-item><a href="javascript:void(0);" (click)="toShowAlert()">撤销出库单</a></ion-item>
    </ion-list>
</div>
<div class="mc" *ngIf="showMc" (click)="closeMC()"></div>